#pragma once

# if SUPPORTTED_OCCLUSION_STATES

#include <mfidl.h>

class CCameraOcclusion : public IMFCameraOcclusionStateReportCallback
{
public:
    CCameraOcclusion();
    virtual ~CCameraOcclusion();

    // IUnknown methods
    STDMETHODIMP QueryInterface(REFIID iid, void** ppv);
    STDMETHODIMP_(ULONG) AddRef();
    STDMETHODIMP_(ULONG) Release();

    // IMFCameraOcclusionStateReportCallback methods
    HRESULT STDMETHODCALLTYPE OnOcclusionStateReport(IMFCameraOcclusionStateReport* occlusionStateReport);

public:
    HRESULT CreateCameraOcclusionStateMonitor(LPCWSTR symbolicName);
    HRESULT StartOcclusionStateMoitor()
    {
        return m_pCameraOcclusionStateMonitor->Start();
    }

    HRESULT StopOcclusionStateMonitor()
    {
        return m_pCameraOcclusionStateMonitor->Stop();
    }

    unsigned int GetSupporttedOcclusionStates()
    {
        return m_pCameraOcclusionStateMonitor->GetSupportedStates();
    }

private:
    long m_nRefCount; // Reference count.
    IMFCameraOcclusionStateMonitor* m_pCameraOcclusionStateMonitor;
};

#endif

